package itheima.GameMax;
public class RoleTest {
    public static void main(String[] args) {
        Role r1 = new Role("乔峰", 100, '男');
        Role r2 = new Role("鸠摩智", 100, '男');
        r1.showRoleInfo();
        r2.showRoleInfo();
        while (true) {
            //r1开始攻击r2
            r1.attack(r2);
            //判断r2还剩多少
            if (r2.getBlood() == 0) {
                System.out.println(r1.getName() + "ko了" + r2.getName());
                break;
            }
            //r2攻击r1
            r2.attack(r1);
            //判断r1还剩多少
            if (r1.getBlood() == 0) {
                System.out.println(r2.getName() + "ko了" + r1.getName());
                break;
            }
        }
    }
}
